package metagrammar;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class TypeTest {
    
    @Before
    public void setUp() throws Exception
    {
    }
    
    @After
    public void tearDown() throws Exception
    {
    }
    
    @Test
    public void testTypeString()
    {
        assertNotNull(new Type("type"));
    }
    
    @Test
    public void testTypeStringTypeArray()
    {
        assertNotNull(new Type("type", Type.ROOT, Type.UNTYPED));
    }
    
    @Test
    public void testGetName()
    {
        assertEquals("root", Type.ROOT.getName());
    }
    
    @Test
    public void testIsSubtypeOf()
    {
        Type type = new Type("type", Type.ROOT);
        assertTrue(type.isSubtypeOf(Type.ROOT));
        assertFalse(type.isSubtypeOf(Type.UNTYPED));

    }
    
}
